<?php namespace App\Http\Middleware;

use App\Http\Models\WebChat;
use Closure;
use App\Http\Models\User;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Session;


class CusAuthMiddleware {

	/**
	 * Handle an incoming request.
	 *
	 * @param  \Illuminate\Http\Request  $request
	 * @param  \Closure  $next
	 * @return mixed
	 */
	public function handle($request, Closure $next)
	{

        if(!User::check())
        {

            return Redirect::to('register');


        }



		return $next($request);
	}


}
